/* eslint-disable max-classes-per-file */
import { JsonProperty, Serializable } from '@/plugins/reflect-metadata';

import { WAIT_HANDLE } from '../const';
import WithdrowItem from './WithdrowItem';

@Serializable()
export class WithdrowQuery {
   @JsonProperty('showPicker')
     showPicker: boolean = false;

    @JsonProperty('pageNum')
      pageNum: number = 1;

    @JsonProperty('pageSize')
      pageSize: number = 30;

    @JsonProperty('status')
      status: number = WAIT_HANDLE;

    get params() {
      return {
        pageNum: this.pageNum,
        pageSize: this.pageSize,
        status: this.status === undefined ? null : this.status,
      };
    }
}

@Serializable()
export class WithdrowOperate {
  @JsonProperty('withdrawalId')
    withdrawalId: number = 0;

  @JsonProperty('status')
    status: boolean = true;

  get params() {
    return {
      withdrawalId: this.withdrawalId,
      status: this.status,
    };
  }
}

@Serializable()
export default class WithdrowList {
  @JsonProperty({ name: 'rows', type: WithdrowItem })
    items: WithdrowItem[] = [];

  @JsonProperty('total')
    total: number = 0;
}
